[Data]
life = 1000
attack = 100
defence = 100
fall.defence_up = 50
liedown.time = 60
airjuggle = 25
sparkno = S6001
guard.sparkno = -1
KO.echo = 0
volume = 0
IntPersistIndex = 0
FloatPersistIndex = 0

[Size]
xscale = 1
yscale = 1
ground.back = 8
ground.front = 8
air.back = 0
air.front = 0
height = 0
attack.dist = 0
proj.attack.dist = 0
proj.doscale = 2
head.pos = -1, -48
mid.pos = -1, -30
shadowoffset = 0
draw.offset = 0,0

[Velocity]
walk.fwd  = 0
walk.back = 0
run.fwd  = 0,0
run.back = 0,0
jump.neu = 0,0
jump.back = 0
jump.fwd = 0
runjump.back = 0,0
runjump.fwd = 0,0
airjump.neu = 0
airjump.back = 0
airjump.fwd = 0

[Movement]
airjump.num = 0
airjump.height = 0
yaccel = .44
stand.friction = .85
crouch.friction = .82

[Quotes]
victory1 = "ass"
;---------------------------------------------------------------------------
;Var List

;***Universal***
;var(0) = Command variable
;var(1) = Famicom Fighters character detection

;var(24) = Test Var
;var(25) = Death State Check
;var(27) = Test Var
;var(32) = Intro Countdown
;fvar(20) = Vel X
;fvar(21) = Vel Y
;fvar(22) = Pos X
;fvar(23) = Pos Y
;fvar(24) = Test Var
;fvar(30) = Special projectile Vel X
;fvar(31) = Special projectile Vel Y
;fvar(32) = Super projectile Vel X
;fvar(33) = Super projectile Vel Y
;fvar(34) = Helper projectile Vel X
;fvar(35) = Helper projectile Vel Y
;fvar(36) = Helper Vel X
;fvar(37) = Helper Vel Y

;***Specific***
;var(2) = Score
;var(3) = Projectiles Left
;var(4) = Grunts Left
;var(5) = Simul/No AI Detection
;var(6) = Opponent Hit

;***Helpers***
;Spawner
;var(0) = Pos X track
;var(4) = Timer for next projectile
;var(5) = Projectile Speed
;var(6) = Projectile Height (0 - Mid, 1 - Low, 2 - High)
;---------------------------------------------------------------------------
; INTRO 
[Statedef 191]
type = S
ctrl = 0
anim = 1
sprpriority = 5

[State 191, 1]
type = AssertSpecial
trigger1 = Time < 180
flag = Intro

[State 0, 2]
type = Helper
trigger1 = !NumHelper(1) && !Var(5)
name = "Spawner"
ID = 1
stateno = 2
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0

[State 191, 3]
type = AssertSpecial
trigger1 = Var(5) 
flag = invisible

[State 191, 4]
type = Explod
trigger1 = !Time && !Var(5)
anim = 0
ID = 190
pos = 0,0
postype = p1
removetime = -2
scale = 1,1
sprpriority = 3
ownpal = 1

[State 0, Helper]
type = Helper
trigger1 = Time = 140 && !Var(5)
name = "Lang"
ID = 190
stateno = 10
pos = 0,0
postype = P1
facing = 1
keyctrl = 0
ownpal = 1

[State 9, 2]
type = PlaySnd
trigger1 = Time = 84
value = S190,0

[State 191, 7]
type = ChangeState
trigger1 = Time = 180
value = 0
;---------------------------------------------------------------------------
;Initialize
[Statedef 0]
type = S
movetype = I
physics = N
anim = 1
sprpriority = 0
ctrl = 0

[State 0, 1]
type = ScreenBound
trigger1 = !Var(5)
value = 0

[State 0, 2]
type = Null
trigger1 = !Time && !NumHelper(70) && !Var(5)
name = "Grunt"
ID = 70
stateno = 5
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0

[State 0, 2]
type = Helper
trigger1 = !NumHelper(1) && !Var(5)
name = "Spawner"
ID = 1
stateno = 2
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0

[State 0, 7]
type = ChangeState
trigger1 = RoundState = 2 && enemy,Ctrl = 1
value = 1

[State 0, 8]
type = ChangeState
trigger1 = RoundState = 2 && Var(5)
value = 5150
;---------------------------------------------------------------------------
;Initialize
[Statedef 1]
type = S
movetype = I
physics = N
anim = 1
sprpriority = 0
ctrl = 0

[State 1, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 1, 2]
type = PosSet
trigger1 = !Time
x = 200

[State 1, 3]
type = Turn
trigger1 = (Pos X <= 0 && Facing = -1) || (Pos X > 0 && Facing = 1)

[State 1, 4]
type = PosSet
trigger1 = enemynear(0),Facing != Facing && enemynear(0),Vel X < 0 && enemynear(0),Ctrl ;&& enemynear(0),Time >= 4
x = Cond(Pos X <= 0, 200,-200)

[State 1, 5]
type = PosSet
trigger1 = 1
x = Cond(pos x <= 0, -200, 200)

[State 0, LifeSet]
type = ChangeState
triggerall = NumHelper(1) && helper(1),Time
trigger1 = Var(3) = 0 && !NumHelper(10) ;Var(4) = 0 && 
value = 5150

;---------------------------------------------------------------------------
;Spawn (Initialize)
[Statedef 2]
type = A
physics = N
velset = 0,0
anim = 1
sprpriority = 0
ctrl = 0

[State 2, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 0, 3]
type = Null;RootVarSet
triggerall = !Time && (root,Var(3) = 0)
trigger1 = root,Cond(1, Var(3):= 10 ,0)


[State 0, Helper]
type = Helper
trigger1 = RoundState = 2 && !NumHelper(20)
name = "Force to Middle"
ID = 20
stateno = 20
pos = -70,0
postype = front
facing = 1
keyctrl = 0
ownpal = 1

[State 2, 4] 
type = ChangeState
trigger1 = RoundState = 2 && Time && enemy,Ctrl
value = 3
;---------------------------------------------------------------------------
;Spawn
[Statedef 3]
type = A
physics = N
velset = 0,0
anim = 1
sprpriority = 0
ctrl = 0

[State 2, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 3, 1]
type = VarSet
trigger1 = !Time && !Var(0)
var(0) = 180 ;*Cond(Random < 499,1,-1)

[State 3, 2]
type = PosSet
trigger1 = 1
x = Var(0)

[State 3, 3]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

[State 0, VarSet1]
type = Null
triggerall = RoundNo = 1 && !Time
trigger1 = Cond(root,Var(3) = 10, Var(4) := 112 && Var(5) := 0 && Var(6) := 0 ,0)
trigger2 = Cond(root,Var(3) = 9, Var(4) := 96 && Var(5) := 0 && Var(6) := 2 ,0)
trigger3 = Cond(root,Var(3) = 8, Var(4) := 96 && Var(5) := 0 && Var(6) := 1 ,0)
trigger4 = Cond(root,Var(3) = 7, Var(4) := 32 && Var(5) := 1 && Var(6) := 2 ,0)
trigger5 = Cond(root,Var(3) = 6, Var(4) := 112 && Var(5) := 0 && Var(6) := 1,0)
trigger6 = Cond(root,Var(3) = 5, Var(4) := 64 && Var(5) := 0 && Var(6) := 0,0)
trigger7 = Cond(root,Var(3) = 4, Var(4) := 56 && Var(5) := 0 && Var(6) := 1,0)
trigger8 = Cond(root,Var(3) = 3, Var(4) := 64 && Var(5) := 0 && Var(6) := 0 ,0)
trigger9 = Cond(root,Var(3) = 2, Var(4) := 48 && Var(5) := 1 && Var(6) := 2,0)
trigger10 = Cond(root,Var(3) = 1, Var(4) := 56 && Var(5) := 1 && Var(6) := 1,0)

[State 0, VarSet1]
type = Null
triggerall = RoundNo = 2 && !Time
trigger1 = Cond(root,Var(3) = 10, Var(4) := 96 && Var(5) := 0 && Var(6) := 0 ,0)
trigger2 = Cond(root,Var(3) = 9, Var(4) := 32 && Var(5) := 0 && Var(6) := 1 ,0)
trigger3 = Cond(root,Var(3) = 8, Var(4) := 65 && Var(5) := 0 && Var(6) := 2 ,0)
trigger4 = Cond(root,Var(3) = 7, Var(4) := 56 && Var(5) := 0 && Var(6) := 0 ,0)
trigger5 = Cond(root,Var(3) = 6, Var(4) := 112 && Var(5) := 1 && Var(6) := 1,0)
trigger6 = Cond(root,Var(3) = 5, Var(4) := 48 && Var(5) := 0 && Var(6) := 2,0)
trigger7 = Cond(root,Var(3) = 4, Var(4) := 56 && Var(5) := 0 && Var(6) := 1,0)
trigger8 = Cond(root,Var(3) = 3, Var(4) := 96 && Var(5) := 1 && Var(6) := 0 ,0)
trigger9 = Cond(root,Var(3) = 2, Var(4) := 96 && Var(5) := 0 && Var(6) := 2,0)
trigger10 = Cond(root,Var(3) = 1, Var(4) := 10 && Var(5) := 1 && Var(6) := 1,0)

[State 0, VarSet1]
type = Null
triggerall = RoundNo >= 3 && !Time
trigger1 = Cond(root,Var(3) = 10, Var(4) := (4+random%10)*8 && Var(5) := 0 && Var(6) := 0, 0)
trigger2 = Cond(root,Var(3) <= 9, Var(4) := (4+random%10)*8 && Var(5) := 0+(Random < 299) && Var(6) := 0+random%3, 0)

[State 4, 6]
type = Helper
triggerall = root,Var(5) = 0 && root,Var(3) && RoundState = 2
trigger1 = !Time
name = "Projectile"
ID = 10
stateno = 5
pos = 0,Cond(Var(6) = 0,enemy,const(size.mid.pos.y),Cond(Var(6) = 1,const(size.head.pos.y)+2,-8))
postype = p1
facing = 1-(2*(Pos X < 0))
keyctrl = 0
ownpal = 0

[State 6, 6]
type = Null ;VarSet
triggerall = !Time
trigger1 = root,Cond(1, Var(3):= Var(3) - 1,0)
var(3) = -1

[State 0, VarSet]
type = VarSet
trigger1 = !Time
var(7) = Var(6)

[State 3, 1]
type = VarSet
trigger1 = Time
var(0) = 180*Cond((Var(4)/8 = [6,8]),-1,1)

[State 4, 7]
type = ChangeState
trigger1 = Time
value = 4
;---------------------------------------------------------------------------
;Spawn (actually spawning holy shit)
[Statedef 4]
type = A
physics = N
anim = 1
velset = 0,0
sprpriority = 0
ctrl = 0

[State 3, 1]
type = DisplaytoClipboard
trigger1 = 1
text = "Vel: x = %d y = %d"
params = Var(5), 69
ignorehitpause = 1

[State 3, 2]
type = ScreenBound
trigger1 = 1
value = 0

[State 0, VarAdd]
type = VarAdd
trigger1 = Var(4)
var(4) = -1

[State 3, 5]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

[State 3, 6] 
type = ChangeState
trigger1 = !Var(4) && (root,Var(3)) && RoundState = 2
value = 3

;---------------------------------------------------------------------------
;Projectile
[Statedef 5]
type = S
movetype = A
physics = N
anim = 10+((10+(10*(RoundNo >= 3 && random < 499)))*(parent,Var(7) != 0))+(1*(parent,Var(5)))
velset = 2+(1.5*(parent,Var(5))),0
sprpriority = 0
ctrl = 0

[State -2, Debug]
type = DisplaytoClipboard
trigger1 = 1
text = "Vel = %d Facing = %d"
params = parent,Var(8), Facing

[State 10, 2]
type = ScreenBound
trigger1 = 1
value = 0

[State 10, 3]
type = NotHitBy
trigger1 = 1
value = ,AT
time = 1

[State 10, 4]
type = HitOverride
trigger1 = 1
attr = SCA,AA,AP
time = -1
stateno = 7
slot = 0

[State 12, 1]
type = HitDef
trigger1 = !Time
attr = S,NA
hitflag = MAF-
animtype = Hard
priority = 1,Miss
damage = 0
pausetime = 1,1
sparkno = S6000
guard.sparkno = -1
sparkxy = -9, 0
hitsound = F5,0
ground.type = High
ground.velocity = 0
ground.slidetime = 10
ground.hittime = 10
air.type = High
air.hittime = 10
air.velocity = -0, 0
guard.dist = 0
fall = 1
kill = (RoundNo >= 5)
guard.kill = (RoundNo >= 5)
fall.kill = (RoundNo >= 5)

[State 4000, 16]
type = ChangeState
trigger1 = NumTarget && MoveHit
value = 6
ignorehitpause = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = (FrontEdgeDist < -40 || RoundState = 3) && !NumTarget
value = 8

;---------------------------------------------------------------------------
;Projectile Hit
[Statedef 6]
type = A
movetype = A
physics = S
velset = 0,0
anim = 1
sprpriority = 0
ctrl = 0

[State 6, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 6, 2]
type = PlayerPush
trigger1 = 1
value = 1
ignorehitpause = 1

[State 6, 3]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

[State 6, 4]
type = TargetLifeAdd
trigger1 = NumTarget && !Time
value = (target,LifeMax) * -1
kill = (RoundNo >= 5)
absolute = 1

[State 6, 5]
type = Null ;VarSet
triggerall = !Time
trigger1 = root,Cond(1, Var(6):= Var(6) + 1,0)
var(2) = -1

[State 6, 6]
type = DestroySelf
trigger1 = !NumTarget && Anim = 1
trigger2 = NumTarget && Anim = 1
trigger2 = target,StateType = L
;---------------------------------------------------------------------------
;Projectile Hit
[Statedef 7]
type = A
movetype = H
physics = S
velset = 0,0
anim = 1
sprpriority = 0
ctrl = 0

[State 7, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7, 2]
type = PlayerPush
trigger1 = 1
value = 1
ignorehitpause = 1

[State 7, 3]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

[State 7, 4]
type = Null ;VarSet
triggerall = !Time
trigger1 = root,Cond(1, Var(2):= Var(2) + 1,0)
var(2) = -1

[State 7, 5]
type = DestroySelf
trigger1 = 1
;---------------------------------------------------------------------------
;Projectile Vanish
[Statedef 8]
type = A
movetype = H
physics = S
velset = 0,0
anim = 1
sprpriority = 0
ctrl = 0

[State 9, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 8, 2]
type = PlayerPush
trigger1 = 1
value = 1
ignorehitpause = 1

[State 8, 3]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

[State 8, 4]
type = DestroySelf
trigger1 = 1
;---------------------------------------------------------------------------
;Lang Jump (Away)
[Statedef 10]
type = A
movetype = I
physics = N
anim = 180
velset = 0,0
sprpriority = 2
ctrl = 0

[State 10, 1]
type = Turn
trigger1 = !Time

[State 10, 2]
type = ScreenBound
trigger1 = 1
value = 0

[State 10, 3]
type = PosAdd
trigger1 = (GameTime % 2) = 0
x = 12
y = -4

[State 10, 4]
type = DestroySelf
trigger1 = FrontEdgeDist < -40
;---------------------------------------------------------------------------
;Lang Jump (Away)
[Statedef 11]
type = A
movetype = I
physics = N
anim = 180
velset = 0,0
sprpriority = 2
ctrl = 0

[State 11, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 11, 2]
type = PosAdd
trigger1 = (Time % 2) = 0
x = 12
y = 4

[State 11, 3]
type = ChangeState
trigger1 = (Time % 2) = 0 && (Pos Y + 4) >= 0
value = 12

;---------------------------------------------------------------------------
;Lang Jump (Away)
[Statedef 12]
type = S
movetype = I
physics = N
anim = Cond(root,Var(3) = 0 && root,Var(6) = 0, 182,181)
velset = 0,0
sprpriority = 2
ctrl = 0

[State 12, 1]
type = PosSet
trigger1 = !Time
y = 0

[State 12, 2]
type = PosAdd
trigger1 = !Time
x = 2

[State 12, 3]
type = PlaySnd
trigger1 = Anim = 181 && (AnimElem = 3 || AnimElem = 5 || AnimElem = 7 || AnimElem = 9)
value = S180,0

[State 12, 4]
type = PlaySnd
trigger1 = Anim = 182 && (AnimElem = 3 || AnimElem = 5 || AnimElem = 7)
value = S190,0
;---------------------------------------------------------------------------
;Spawn (Initialize)
[Statedef 20]
type = A
movetype = A
physics = N
velset = 0,0
anim = 40
sprpriority = 0
ctrl = 0

[State 720, 1]
type = HitDef
Trigger1 = !Time
attr = S, NT
hitflag = MAFD
priority = 1, Hit
sparkno = -1
p1sprpriority = 1
p1facing = 1
p2facing = 1
p1stateno = 21
p2stateno = 22
guard.dist = 0
fall = 1
fall.recovertime = 1
numhits = 0

[State 0, DestroySelf]
type = DestroySelf
trigger1 = Time
;---------------------------------------------------------------------------
;Spawn (Initialize)
[Statedef 21]
type = A
movetype = A
physics = N
velset = 0,0
anim = 1
sprpriority = 0
ctrl = 0

[State 0, DestroySelf]
type = DestroySelf
trigger1 = !NumTarget
;---------------------------------------------------------------------------
;Spawn (Initialize)
[Statedef 22]
type = A
movetype = H
physics = N
sprpriority = 0
ctrl = 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !Time
value = 20

[State 0, VelSet]
type = VelSet
trigger1 = 1
x = 2.5

[State 0, ChangeState]
type = ChangeState
trigger1 = Facing = 1 && Vel X < Pos X
trigger2 = Facing = -1 && Vel X > Pos X
value = 23
;---------------------------------------------------------------------------
;Spawn (Initialize)
[Statedef 23]
type = A
movetype = H
physics = N
velset = 0,0
sprpriority = 0
ctrl = 0

[State 23, 1]
type = PosSet
trigger1 = !Time
x = 0

[State 23, 2]
type = SelfState
trigger1 = !Time
value = 0

